/*! For license information please see sdk.js.LICENSE.txt */ (()=>{"use strict";var t,e;function i(t,e){if(!t)return null;if("closest"in t)return t.closest(e);const i=t;if("function"==typeof i.matches&&i.matches(e))return i;let n=i.parentElement;for(;n;){if("function"==typeof n.matches&&n.matches(e))return n;n=n.parentElement}return null}!function(t){t.ANALYTICS_SEND_EVENT="analytics:send-event",t.ANALYTICS_STARTED="analytics:started",t.CALLACTION_ACTIVE="callaction:active",t.CALLACTION_ELEMENTS_CHANGED="callaction:elements-changed",t.CALLACTION_CONNECTED="callaction:connected",t.CONTROL_BAR_CLOSER="control-bar:closer",t.CONTROLS_ACTIVE="controls:active",t.CONTROLS_INACTIVE="controls:inactive",t.CONTROLS_ITEMS="controls:items",t.CONVERSION_TRACKING_DISABLED="conversion-tracking:disabled",t.CONVERSION_TRACKING_ENABLED="conversion-tracking:enabled",t.CONVERSION_TRACKING_UPDATE="conversion-tracking:update",t.FAKEBAR_ACTIVE="fakebar:active",t.FAKEBAR_INACTIVE="fakebar:inactive",t.FAKEBAR_PROGRESS="fakebar:progress",t.FAKEBAR_WIDTH="fakebar:width",t.FULLSCREEN_ENTER="fullscreen:enter",t.FULLSCREEN_EXIT="fullscreen:exit",t.HEADLINE_ACTIVE="headline:active",t.HEADLINE_CHANGED="headline:changed",t.HEADLINE_INACTIVE="headline:inactive",t.HEADLINE_RENDERED="headline:rendered",t.HLS_FIRST_SEGMENT_LOADED="first-segment-loaded",t.HLS_LEVEL_SWITCHED="level-switched",t.HLS_LEVELS_LOADED="levels-loaded",t.HLS_MOUNT="mount",t.IFRAME_CONNECTED="iframe:connected",t.IFRAME_OPEN_LINK="iframe:open-link",t.LICENSE_ALLOWED="license:allowed",t.LICENSE_DENIED="license:denied",t.LICENSE_ERROR="license:error",t.MINIHOOK_ACTIVE="minihook:active",t.MINIHOOK_INACTIVE="minihook:inactive",t.MINIHOOK_ITEMS="minihook:items",t.PITCH_TIME="pitch:time",t.PLAYER_BLOCKED="player:blocked",t.PLAYER_CONFIG_UPDATED="player:config-updated",t.PLAYER_EXIT_CLICK="player:exit-click",t.PLAYER_OFFLINE="player:offline",t.PLAYER_ONLINE="player:online",t.PLAYER_READY="player:ready",t.PLAYER_RESIZE="player:resize",t.PLAYER_UNBLOCKED="player:unblocked",t.PRELOAD_EXPIRED="preload:expired",t.PRELOAD_REMOVED="preload:removed",t.RESUME_ACTIVE="resume:active",t.RESUME_CONTINUE="resume:continue",t.RESUME_INACTIVE="resume:inactive",t.RESUME_RESTART="resume:restart",t.SMARTAUTOPLAY_ACTIVE="smartautoplay:active",t.SMARTAUTOPLAY_INACTIVE="smartautoplay:inactive",t.SMARTAUTOPLAY_PLAY="smartautoplay:play",t.SMARTAUTOPLAY_PROBE_SUCCESS="smartautoplay:probe-success",t.SMARTAUTOPLAY_SELECTED="smartautoplay:selected",t.SMARTAUTOPLAY_VIDEO_READY="smartautoplay:video-ready",t.SUBTITLE_ACTIVE="subtitle:active",t.SUBTITLE_CONFIG_CHANGE="subtitle:config-change",t.SUBTITLE_INACTIVE="subtitle:inactive",t.SUBTITLE_TRACK_CHANGE="subtitle:track-change",t.TURBO_ACTIVE="turbo:active",t.TURBO_INACTIVE="turbo:inactive",t.TURBO_SPEED_CHANGED="turbo:speed-changed",t.TURBO_TYPE="turbo:type",t.URL_INJECTION="url-injection",t.VIDEO_CANPLAY="video:canplay",t.VIDEO_CANPLAYTHROUGH="video:canplaythrough",t.VIDEO_ENDED="video:ended",t.VIDEO_FORWARD="video:forward",t.VIDEO_LOADEDDATA="video:loadeddata",t.VIDEO_LOADEDMETADATA="video:loadedmetadata",t.VIDEO_PAUSE="video:pause",t.VIDEO_PLAY="video:play",t.VIDEO_PLAYING="video:playing",t.VIDEO_PROGRESS="video:progress",t.VIDEO_READY="video:ready",t.VIDEO_REWIND="video:rewind",t.VIDEO_SPEEDCHANGE="video:speedchange",t.VIDEO_TIMEUPDATE="video:timeupdate",t.VIDEO_TIMEUPDATE_MS="video:timeupdate-ms",t.VIDEO_VOLUMECHANGE="video:volumechange",t.VIDEO_WAITING="video:waiting"}(t||(t={})),function(t){t.iframeOpenLink="iframeOpenLink",t.callactionElementsChanged="callactionElementsChanged",t.connect="connect",t.disableConversionTraking="disableConversionTraking",t.displayHeadline="displayHeadline",t.displayHiddenElements="displayHiddenElements",t.displayCallActions="displayCallActions",t.enableConversionTraking="enableConversionTraking",t.fullscreen="fullscreen",t.fullscreenEnter="fullscreenEnter",t.fullscreenExit="fullscreenExit",t.insertAfter="insertAfter",t.insertBefore="insertBefore",t.mute="mute",t.pitchTime="pitchTime",t.reply="reply",t.resume="resume",t.smartautoplayActive="smartautoplayActive",t.smartautoplayInactive="smartautoplayInactive",t.smartautoplayVideoReady="smartautoplayVideoReady",t.smartplay="smartplay",t.unmute="unmute",t.updateUrlParams="updateUrlParams",t.videoEnded="videoEnded",t.videoPause="videoPause",t.videoPlay="videoPlay",t.videoSeek="videoSeek",t.videoSpeed="videoSpeed",t.videoTimeUpdate="videoTimeUpdate",t.volumeChange="volumeChange"}(e||(e={}));class n{constructor(t,e=(t,e)=>t){this.win=window,this.updater=e,this.logger=t,this.setEvents()}findClickableParent(t){try{for(;t;){if(["A","BUTTON","INPUT"].includes(t.tagName)){if("A"===t.tagName&&t.hasAttribute("href"))return t;if(("BUTTON"===t.tagName||"INPUT"===t.tagName)&&"submit"===t.type&&t.form)return t}t=t.parentElement}return null}catch(t){return this.logger.error("Error finding clickable parent",t),null}}handleFormElement(t){const e=t.form;e&&(e.action?e.action=this.injectIntoURL(e.action,t):this.logger.warn("Form element has no action",{element:t}))}handleLinkElement(t){const e=t.getAttribute("href");if(e)try{const i=window.location.href.split("#")[0];e.split("#")[0]===i||e.startsWith("#")||e.startsWith("javascript:")||(t.href=this.injectIntoURL(e,t))}catch(e){this.logger.warn(`Skipping link element due to error: ${e}, element: ${t}`)}}injectIntoURL(t,e){try{return this.updater(t,e)}catch(e){return this.logger.warn(`Error updating URL: ${t}`,{error:e}),t}}setEvents(){const t=t=>{try{const e=this.findClickableParent(t.target);e&&!this.shouldIgnoreElement(e)&&("A"===e.tagName?this.handleLinkElement(e):"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||"submit"!==e.type||this.handleFormElement(e))}catch(t){this.logger.error("Error setting events",t)}};["mousedown","touchstart","mouseover"].forEach((e=>{this.win.addEventListener(e,t)}))}shouldIgnoreElement(t){return null!=i(t,".smartplayer-ignore-click-event")}}const a="smartplayer/message-text-v4",r=[".vturb-callaction-wrapper",".callaction__html",".callaction__button"];function o({prefix:t,suffix:e}={}){if(void 0!==window.crypto&&"function"==typeof window.crypto.randomUUID)return`${null!=t?t:""}${window.crypto.randomUUID()}${null!=e?e:""}`;const i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return`${null!=t?t:""}${i}${null!=e?e:""}`}class s extends Error{constructor(t,e,i,n,a="4.2.0.1",r){super(t),this.module=e,this.traceId=i,this.spanId=n,this.playerVersion=a,this.metadata=r}}const l=new class{constructor(){this.traceId=null,this.contexts={},this.sentryKey="c66faa8e28e47bb7a9baa128334e4b48",this.sentryUrl="https://sentry.io/api/4509130195468288/envelope/"}send(t){this.request(t)}stackToFrame(t){const e=/at (.*) \((.*):(\d+):(\d+)\)/;return t.split("\n").map((t=>{const i=t.match(e);if(!i)return null;const[,n,a,r,o]=i;return{colno:parseInt(o),filename:a,function:n,in_app:!0,lineno:parseInt(r)}})).filter((t=>null!==t))}buildEnvelope(t){var e;const i=new Date,n=i.getTime()/1e3,a=o();return`${JSON.stringify({event_id:a,sdk:{name:"smartplayer",version:t.playerVersion},sent_at:i.toISOString(),trace:{environment:"production",public_key:this.sentryKey,trace_id:this.traceId}})}\n${JSON.stringify({type:"event"})}\n${JSON.stringify({contexts:Object.assign(Object.assign(Object.assign({},this.deviceContext()),this.gpuContext()),{state:{type:"smartplayer",value:t.metadata}}),environment:"production",event_id:a,exception:[{module:t.module,stacktrace:{frames:this.stackToFrame(t.stack||""),rawstacktrace:t.stack},value:t.message}],level:"error",logger:"smartplayer",platform:"javascript",release:`smartplayer@${t.playerVersion}`,request:{headers:{"User-Agent":navigator.userAgent},url:window.location.href},sdk:{integrations:["Logger"],name:"smartplayer",version:t.playerVersion},timestamp:n,transaction:t.module||"unknown",user:{id:null===(e=t.metadata)||void 0===e?void 0:e.oid,ip_address:"{{auto}}"}})}`}deviceContext(){var t,e;return this.contexts.device||(this.contexts.device={device:{arch:navigator.platform,device_type:/Mobi|Android|iPhone|iPad|Windows Phone/i.test(navigator.userAgent)?"Handheld":"Desktop",family:navigator.platform,language:navigator.language,manufacturer:navigator.vendor||void 0,memory_size:navigator.deviceMemory?1024*navigator.deviceMemory*1024*1024:void 0,model:navigator.userAgent.split(/[()]/)[1],name:navigator.userAgent,online:navigator.onLine,orientation:(null===(e=null===(t=window.screen.orientation)||void 0===t?void 0:t.type)||void 0===e?void 0:e.includes("portrait"))?"portrait":"landscape",processor_count:navigator.hardwareConcurrency,screen_density:window.devicePixelRatio,screen_height_pixels:window.screen.height,screen_resolution:`${window.screen.width}x${window.screen.height}`,screen_width_pixels:window.screen.width,supports_accelerometer:"DeviceMotionEvent"in window,supports_audio:"AudioContext"in window,supports_gyroscope:"DeviceOrientationEvent"in window,supports_location_service:"geolocation"in navigator,supports_vibration:"vibrate"in navigator,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}),this.contexts.device}gpuContext(){return this.contexts.gpu||(this.contexts.gpu={gpu:{api_type:window.WebGLRenderingContext?"WebGL":"Unknown",memory_size:null,multi_threaded_rendering:!1,name:(()=>{const t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)return"Unknown";const i=e.getExtension("WEBGL_debug_renderer_info");return i?e.getParameter(i.UNMASKED_RENDERER_WEBGL):"Unknown"})(),npot_support:document.createElement("canvas").getContext("webgl")?"Full":"Unknown",vendor_name:(()=>{const t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)return"Unknown";const i=e.getExtension("WEBGL_debug_renderer_info");return i?e.getParameter(i.UNMASKED_VENDOR_WEBGL):"Unknown"})(),version:(()=>{const t=document.createElement("canvas").getContext("webgl");return t?t.getParameter(t.VERSION):"Unknown"})()}}),this.contexts.gpu}request(t){const e=new XMLHttpRequest;e.open("POST",this.sentryUrl,!0),e.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),e.setRequestHeader("X-Sentry-Auth",`Sentry sentry_version=7, sentry_key=${this.sentryKey}, sentry_client=smartplayer/4.1.0`),e.withCredentials=!1,e.send(this.buildEnvelope(t))}};let c;class d{constructor(t,e,i,n,a){this.spanId=o(),this.traceId=t,this.level=e,this.message=i,this.attributes=n,this.reference=a}render(){"error"===this.level&&l.send(this.renderError()),"debug"===this.level&&p("debug",this.message)?this.debug():"info"===this.level&&p("info",this.message)?this.info():"warn"===this.level&&p("warn",this.message)?this.warn():"error"===this.level&&p("error",this.message)?this.error():"trace"===this.level&&p("trace",this.message)&&this.trace()}renderMessage(){const t=[`${this.prettyLevel()} ${this.message}`];return this.attributes&&t.push(this.attributes),t}debug(){console.debug(...this.renderMessage())}error(){console.error(...this.renderMessage())}extractMetadataFromReference(t){var e,i;if(!t)return{};let n=t;return(null==n?void 0:n.player)&&(n=n.player),(null==n?void 0:n.config)?{config:n.config,device_id:null===(e=n.analytics)||void 0===e?void 0:e.deviceId,oid:n.config.oid,player_id:n.config.id,session_id:null===(i=n.analytics)||void 0===i?void 0:i.sessionId}:{}}info(){console.info(...this.renderMessage())}prettyLevel(){const t=this.level.toUpperCase();return`${{debug:{color:"",description:"Detailed debug information"},error:{color:"",description:"Critical errors"},info:{color:"",description:"General information"},trace:{color:"",description:"Detailed tracing"},warn:{color:"",description:"Important warnings"}}[this.level].color}[${t}]: `}renderError(){const t=this.traceId,e="4.2.0.1";let i;try{i=this.extractMetadataFromReference(this.reference)}catch(t){i={}}try{const n=this.message,a=/^\[(.*)\]|^(\w+):\s/g.exec(n);return new s(n,(null==a?void 0:a[1])||(null==a?void 0:a[2])||"",t,this.spanId,e,i)}catch(n){return new s(this.message,"Undefined",t,this.spanId,e,i)}}trace(){console.debug(...this.renderMessage())}warn(){console.warn(...this.renderMessage())}}class h{constructor(t,e){this.named=t,this.traceId=o(),this.reference=e;const i=new URL(window.location.href).searchParams.get("logLevel");i&&(h.level=i)}debug(t,e){new d(this.traceId,"debug",this.prefixedMessage(t),e,this.reference).render()}error(t,e){new d(this.traceId,"error",this.prefixedMessage(t),e,this.reference).render()}group(t,e){return new u(this.traceId,t,this.prefixedMessage(e),this.reference)}groupDebug(t){return this.group("debug",this.prefixedMessage(t))}groupError(t){return this.group("error",this.prefixedMessage(t))}groupInfo(t){return this.group("info",this.prefixedMessage(t))}groupTrace(t){return this.group("trace",this.prefixedMessage(t))}groupWarn(t){return this.group("warn",this.prefixedMessage(t))}info(t,e){new d(this.traceId,"info",this.prefixedMessage(t),e,this.reference).render()}trace(t,e){new d(this.traceId,"trace",this.prefixedMessage(t),e,this.reference).render()}warn(t,e){new d(this.traceId,"warn",this.prefixedMessage(t),e,this.reference).render()}prefixedMessage(t){return this.named?`${this.named}: ${t}`:t}}h.level="warn";class u{constructor(t,e,i,n){this.traceId=t,this.reference=n,this.logMessage=new d(t,e,i,n),this.children=[]}addMessage(t,e,i){return this.children.push(new d(this.traceId,t,e,i,this.reference)),this}debug(t,e){return this.addMessage("debug",t,e)}end(){this.children.length>0?this.render():this.logMessage.render()}error(t,e){return this.addMessage("error",t,e)}info(t,e){return this.addMessage("info",t,e)}render(){p(this.logMessage.level,this.logMessage.message)&&(console.groupCollapsed(...this.logMessage.renderMessage()),this.children.forEach((t=>t.render())),console.groupEnd())}trace(t,e){return this.addMessage("trace",t,e)}warn(t,e){return this.addMessage("warn",t,e)}}function p(t,e){var i;const n=["trace","debug","info","warn","error"],a=n.indexOf(t),r=n.indexOf(h.level);if(void 0===c&&(null===(i=null===location||void 0===location?void 0:location.search)||void 0===i?void 0:i.includes("logMatch"))){const t=location.search.match(/logMatch=([^&]*)/);c=t?new RegExp(decodeURIComponent(t[1]),"i"):null}else void 0===c&&(c=null);return a>=r&&(!c||!e||c.test(e))}const m=()=>window.innerWidth<=450?"100%":"var(--player-vertical-width, 400px)";const v=window,g=v.ShadowRoot&&(void 0===v.ShadyCSS||v.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),b=new WeakMap;class _{constructor(t,e,i){if(this._$cssResult$=!0,i!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(g&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=b.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&b.set(e,t))}return t}toString(){return this.cssText}}const y=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new _(i,t,f)},E=g?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new _("string"==typeof t?t:t+"",void 0,f))(e)})(t):t;var A;const w=window,$=w.trustedTypes,T=$?$.emptyScript:"",C=w.reactiveElementPolyfillSupport,x={toAttribute(t,e){switch(e){case Boolean:t=t?T:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},I=(t,e)=>e!==t&&(e==e||t==t),S={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:I},k="finalized";class L extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const a=this[t];this[e]=n,this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||S}static finalize(){if(this.hasOwnProperty(k))return!1;this[k]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(E(t))}else void 0!==t&&e.push(E(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{g?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),n=v.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=S){var n;const a=this.constructor._$Ep(t,i);if(void 0!==a&&!0===i.reflect){const r=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:x).toAttribute(e,i.type);this._$El=t,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,a=n._$Ev.get(t);if(void 0!==a&&this._$El!==a){const t=n.getPropertyOptions(a),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:x;this._$El=a,this[a]=r.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||I)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var M;L[k]=!0,L.elementProperties=new Map,L.elementStyles=[],L.shadowRootOptions={mode:"open"},null==C||C({ReactiveElement:L}),(null!==(A=w.reactiveElementVersions)&&void 0!==A?A:w.reactiveElementVersions=[]).push("1.6.3");const O=window,N=O.trustedTypes,R=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",U=`lit$${(Math.random()+"").slice(9)}$`,D="?"+U,z=`<${D}>`,H=document,V=()=>H.createComment(""),B=t=>null===t||"object"!=typeof t&&"function"!=typeof t,W=Array.isArray,j="[ \t\n\f\r]",Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,G=/>/g,K=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,X=/"/g,J=/^(?:script|style|textarea|title)$/i,Z=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),Q=(Z(1),Z(2),Symbol.for("lit-noChange")),tt=Symbol.for("lit-nothing"),et=new WeakMap,it=H.createTreeWalker(H,129,null,!1);function nt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(e):e}const at=(t,e)=>{const i=t.length-1,n=[];let a,r=2===e?"":"",o=Y;for(let e=0;e"===l[0]?(o=null!=a?a:Y,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?K:'"'===l[3]?X:q):o===X||o===q?o=K:o===F||o===G?o=Y:(o=K,a=void 0);const h=o===K&&t[e+1].startsWith("/>")?" ":"";r+=o===Y?i+z:c>=0?(n.push(s),i.slice(0,c)+P+i.slice(c)+U+h):i+U+(-2===c?(n.push(void 0),e):h)}return[nt(t,r+(t[i]||"")+(2===e?"":"")),n]};class rt{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let a=0,r=0;const o=t.length-1,s=this.parts,[l,c]=at(t,e);if(this.el=rt.createElement(l,i),it.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=it.nextNode())&&s.length0){n.textContent=N?N.emptyScript:"";for(let i=0;iW(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==tt&&B(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:n}=t,a="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=rt.createElement(nt(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===a)this._$AH.v(i);else{const t=new st(a,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=et.get(t.strings);return void 0===e&&et.set(t.strings,e=new rt(t)),e}T(t){W(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const a of t)n===e.length?e.push(i=new lt(this.k(V()),this.k(V()),this,this.options)):i=e[n],i._$AI(a),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=tt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const a=this.strings;let r=!1;if(void 0===a)t=ot(this,t,e,0),r=!B(t)||t!==this._$AH&&t!==Q,r&&(this._$AH=t);else{const n=t;let o,s;for(t=a[0],o=0;o{var n,a;const r=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let o=r._$litPart$;if(void 0===o){const t=null!==(a=null==i?void 0:i.renderBefore)&&void 0!==a?a:null;r._$litPart$=o=new lt(e.insertBefore(V(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return Q}}bt.finalized=!0,bt._$litElement$=!0,null===(gt=globalThis.litElementHydrateSupport)||void 0===gt||gt.call(globalThis,{LitElement:bt});const _t=globalThis.litElementPolyfillSupport;null==_t||_t({LitElement:bt}),(null!==(ft=globalThis.litElementVersions)&&void 0!==ft?ft:globalThis.litElementVersions=[]).push("3.3.3");const yt=y`:host{height:auto;display:block;z-index:1;font-size:16px}:host,div[id^=vturb-callaction-container-]{--player-vertical-width:400px;--base-transition-duration:0.3s;--base-transition-delay:0s;--base-transition-cubic:cubic-bezier(0.25, 0.1, 0.25, 1);--base-transition:var(--base-transition-duration) var(--base-transition-cubic) var(--base-transition-delay);--base-linear-transition:0.2s linear;--style-background:#000;--style-foreground:#fff;--style-font-family:Roboto,Helvetica,Arial,Tahoma,sans-serif;--style-background-opacity:rgba(0, 0, 0, 0.7);--style-hover-background:rgba(255, 255, 255, .1);--style-dark-hover-background:rgba(0, 0, 0, .85);--fakebar-height:0;--control-index:5;--control-padding:0.625em;--control-font-size:1.5em;--control-height:6.125em;--control-translate-y:100%;--control-gap-vertical:0.875em;--control-gap-horizontal:0.625em;--control-border-radius:0.3em;--control-button-size:1.5em;--control-mobile-button-padding:1em;--control-mobile-button-featured-padding:1.5em;--control-mobile-button-icon-size:2em;--control-mobile-button-featured-icon-size:3em;--progressbar-background-color:rgba(255, 255, 255, 0.2);--progressbar-buffer-color:rgba(255, 255, 255, 0.4);--progressbar-handle-color:var(--style-foreground, #ffffff);--progressbar-height:0.25em;--progressbar-handle-size:0.75em;--headline-font-family:inherit;--headline-margin-bottom:1.875em;--resume-background-color:var(--style-background);--resume-blur:0.3125em;--resume-font-size:1em;--resume-foreground-color:var(--style-foreground);--resume-index:10;--resume-line-height:1.3;--resume-min-width:180px;--thumbsniper-background-color:var(--style-background);--thumbsniper-image-fit:contain;--thumbsniper-index:100;--thumbsniper-button-border-radius:5px;--thumbsniper-button-color:var(--style-foreground);--thumbsniper-button-margin:1.25em;--thumbsniper-button-font-size:1em;--thumbsniper-button-line-height:1.2;--thumbsniper-button-font-weight:700;--thumbsniper-button-size-lg:1.5em;--thumbsniper-button-size-md:1.25em;--thumbsniper-button-size-sm:1em;--callaction-background-color:var(--style-background);--callaction-index:100;--callaction-button-border-radius:5px;--callaction-button-color:var(--style-foreground);--callaction-button-margin:1.25em;--callaction-button-font-size:1em;--callaction-button-line-height:1.2;--callaction-button-font-weight:700;--callaction-button-size-lg:1.5em;--callaction-button-size-md:1.25em;--callaction-button-size-sm:1em;--callaction-outside-margin:1.25em;--callaction-button-display:inline-block;--volume-slider-width:3.75em;--volume-slider-height:0.25em;--volume-slider-diameter:0.9375em;--player-border-radius:none;--player-box-shadow:none;font-family:var(--style-font-family,sans-serif);color:var(--style-foreground);--bezel-display:initial;--bezel-color:#ffffff;--bezel-animation-duration:0.5s;--bezel-animation-timing:linear;--bezel-scale-start:1;--bezel-scale-end:2;--bezel-opacity-start:1;--bezel-opacity-end:0;--bezel-icon-size:5em;--bezel-icon-padding:1.25em;--bezel-background-color:rgba(0, 0, 0, 0.5);--bezel-border-radius:50%;--bezel-icon-fill:#ffffff;--bezel-loading-min-width:100px;--bezel-loading-width:45%;--bezel-loading-max-width:200px;--bigplay-base-size:10em;--bigplay-border-radius:5em;--bigplay-background:transparent;--bigplay-opacity:0.9;--bigplay-padding-y:1.6em;--bigplay-padding-x:0.8em;--bigplay-size-360:6.5em;--bigplay-size-480:5.75em;--bigplay-size-550:7.5em;--subtitle-max-width:75%;--subtitle-max-width-small:85%;--subtitle-text-shadow:0.5px 0.5px 0.5px rgba(0, 0, 0, 0.8);--subtitle-padding:0.25em 0.4em;--subtitle-line-height:1.675;--subtitle-font-weight:500;--subtitle-letter-spacing:0.03em}:host .m-w-360,div[id^=vturb-callaction-container-] .m-w-360{font-size:10px}:host .m-w-480,div[id^=vturb-callaction-container-] .m-w-480{font-size:11px}:host .m-w-550,div[id^=vturb-callaction-container-] .m-w-550{font-size:12px}:host .m-w-768,div[id^=vturb-callaction-container-] .m-w-768{font-size:13px}:host .m-w-1024,div[id^=vturb-callaction-container-] .m-w-1024{font-size:14px}:host .m-w-1280,div[id^=vturb-callaction-container-] .m-w-1280{font-size:16px}:host .m-w-1440,div[id^=vturb-callaction-container-] .m-w-1440{font-size:16.5px}:host .m-w-1600,div[id^=vturb-callaction-container-] .m-w-1600{font-size:17px}:host .m-w-1920,div[id^=vturb-callaction-container-] .m-w-1920{font-size:18px}.no-pointer,.no-pointer *{pointer-events:none}.pointer,.pointer *{pointer-events:auto}vturb-headline{font-family:var(--headline-font-family,inherit)}vturb-player{height:auto;display:block}`,Et=y`div[id^=vturb-callaction-container-] .callaction__slot:root,vturb-smartplayer:root{--callaction-button-margin:1.25em;--callaction-button-size-lg:1.5em;--callaction-button-size-md:1.25em;--callaction-button-size-sm:1em}div[id^=vturb-callaction-container-] .callaction__slot .callaction,vturb-smartplayer .callaction{font-size:18px;box-sizing:border-box;width:100%}div[id^=vturb-callaction-container-] .callaction__slot .callaction--outside,vturb-smartplayer .callaction--outside{display:flex;justify-content:center;align-items:center;flex-direction:column}div[id^=vturb-callaction-container-] .callaction__slot .callaction--inside,vturb-smartplayer .callaction--inside{position:absolute;top:0;left:0;height:100%;z-index:var(--callaction-index);pointer-events:none}div[id^=vturb-callaction-container-] .callaction__slot .callaction__button,vturb-smartplayer .callaction__button{display:var(--callaction-button-display,inline-block);pointer-events:all;padding:.5em .7em;border:0 solid transparent;background-color:var(--callaction-background);color:var(--callaction-color);font-size:var(--callaction-button-font-size);font-weight:var(--callaction-button-font-weight);line-height:var(--callaction-button-line-height);text-align:center;border-radius:var(--callaction-button-border-radius);text-decoration:none;transition:all .2s ease-in-out}div[id^=vturb-callaction-container-] .callaction__slot .callaction__button:hover,vturb-smartplayer .callaction__button:hover{background-color:var(--callaction-background-hover,var(--callaction-background));color:var(--callaction-color-hover,var(--callaction-color))}.callaction--inside div[id^=vturb-callaction-container-] .callaction__slot .callaction__button,.callaction--inside vturb-smartplayer .callaction__button{position:absolute}.callaction--outside div[id^=vturb-callaction-container-] .callaction__slot .callaction__button,.callaction--outside vturb-smartplayer .callaction__button{margin:var(--callaction-outside-margin) 0}div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--lg,vturb-smartplayer .callaction__button--lg{font-size:1em;padding:.75em 1em}.m-w-550 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--lg,.m-w-550 vturb-smartplayer .callaction__button--lg,.m-w-768 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--lg,.m-w-768 vturb-smartplayer .callaction__button--lg{font-size:1em;padding:.5em .75em}.m-w-360 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--lg,.m-w-360 vturb-smartplayer .callaction__button--lg,.m-w-480 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--lg,.m-w-480 vturb-smartplayer .callaction__button--lg{font-size:1em;padding:.250000005em .5em}div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--md,vturb-smartplayer .callaction__button--md{font-size:1em;padding:.5em .75em}.m-w-550 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--md,.m-w-550 vturb-smartplayer .callaction__button--md,.m-w-768 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--md,.m-w-768 vturb-smartplayer .callaction__button--md{font-size:1em;padding:.375em .5em}.m-w-360 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--md,.m-w-360 vturb-smartplayer .callaction__button--md,.m-w-480 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--md,.m-w-480 vturb-smartplayer .callaction__button--md{font-size:1em;padding:.25em .375em}div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--sm,vturb-smartplayer .callaction__button--sm{font-size:1em;padding:.25em .5em}.m-w-550 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--sm,.m-w-550 vturb-smartplayer .callaction__button--sm,.m-w-768 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--sm,.m-w-768 vturb-smartplayer .callaction__button--sm{font-size:1em;padding:.25em .375em}.m-w-360 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--sm,.m-w-360 vturb-smartplayer .callaction__button--sm,.m-w-480 div[id^=vturb-callaction-container-] .callaction__slot .callaction__button--sm,.m-w-480 vturb-smartplayer .callaction__button--sm{font-size:1em;padding:.125em .25em}`,At=y`.callaction{font-size:18px;width:100%}.callaction--outside{display:flex;justify-content:center;align-items:center;flex-direction:column}.callaction--inside{position:absolute;top:0;left:0;height:100%;z-index:var(--callaction-index);pointer-events:none}.callaction__button{display:var(--callaction-button-display,inline-block);pointer-events:all;padding:0;border:0 solid transparent;background-color:var(--callaction-background);color:var(--callaction-color);font-size:var(--callaction-button-font-size);font-weight:var(--callaction-button-font-weight);line-height:var(--callaction-button-line-height);text-align:center;border-radius:var(--callaction-button-border-radius);text-decoration:none;transition:all .2s ease-in-out}.callaction__button:hover{background-color:var(--callaction-background-hover,var(--callaction-background));color:var(--callaction-color-hover,var(--callaction-color))}.callaction--inside .callaction__button{position:absolute}.callaction--outside .callaction__button{margin:var(--callaction-outside-margin) 0}.callaction__button--lg{font-size:calc(var(--callaction-button-size-lg)*1)}.m-w-550 .callaction__button--lg,.m-w-768 .callaction__button--lg{font-size:calc(var(--callaction-button-size-lg)*.8333333333)}.m-w-360 .callaction__button--lg,.m-w-480 .callaction__button--lg{font-size:calc(var(--callaction-button-size-lg)*.6666666667)}.callaction__button--md{font-size:calc(var(--callaction-button-size-md)*1)}.m-w-550 .callaction__button--md,.m-w-768 .callaction__button--md{font-size:calc(var(--callaction-button-size-md)*.8)}.m-w-360 .callaction__button--md,.m-w-480 .callaction__button--md{font-size:calc(var(--callaction-button-size-md)*.7)}.callaction__button--sm{font-size:calc(var(--callaction-button-size-sm)*1)}.m-w-550 .callaction__button--sm,.m-w-768 .callaction__button--sm{font-size:calc(var(--callaction-button-size-sm)*.875)}.m-w-360 .callaction__button--sm,.m-w-480 .callaction__button--sm{font-size:calc(var(--callaction-button-size-sm)*.75)}.callaction__button--tl{top:var(--callaction-button-margin);left:var(--callaction-button-margin)}.callaction__button--tc{top:var(--callaction-button-margin);left:50%;transform:translateX(-50%)}.callaction__button--tr{top:var(--callaction-button-margin);right:var(--callaction-button-margin)}.callaction__button--cl{top:50%;left:var(--callaction-button-margin);transform:translateY(-50%)}.callaction__button--cc{top:50%;left:50%;transform:translate(-50%,-50%)}.callaction__button--cr{top:50%;right:var(--callaction-button-margin);transform:translateY(-50%)}.callaction__button--bl{bottom:var(--callaction-button-margin);left:var(--callaction-button-margin)}.callaction__button--bc{bottom:var(--callaction-button-margin);left:50%;transform:translateX(-50%)}.callaction__button--br{bottom:var(--callaction-button-margin);right:var(--callaction-button-margin)}`;var wt,$t,Tt,Ct,xt,It,St,kt,Lt,Mt,Ot,Nt=function(t,e,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(t,i):a?a.value=i:e.set(t,i),i},Rt=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class Pt{constructor({iframe:t,controller:e}){wt.add(this),$t.set(this,void 0),Tt.set(this,void 0),Ct.set(this,void 0),xt.set(this,void 0),kt.set(this,(t=>{const e=Rt(this,$t,"f").doc.createElement("a");e.href=t.link,e.innerHTML=t.content,e.target=t.openInNewTab?"_blank":"_parent",e.style.setProperty("--callaction-background",t.colors.background),e.style.setProperty("--callaction-background-hover",t.colors.backgroundHover),e.style.setProperty("--callaction-color",t.colors.text),e.style.setProperty("--callaction-color-hover",t.colors.textHover),e.classList.add("callaction","callaction__button",`callaction__button--${t.size}`);const i=Rt(this,$t,"f").doc.createElement("div");i.classList.add("vturb-callaction-wrapper","callaction__slot",`callaction__button--${t.size}`),i.id=`vturb-callaction-${t.id}`,i.style.display="none",i.appendChild(e),Rt(this,Ct,"f").appendChild(i)})),Lt.set(this,(t=>{const e=function(t,e){let i=t;try{(function(t){const e=(new DOMParser).parseFromString(t,"text/html").body;return!(!(e&&e.textContent&&e.textContent.trim())||e.children.length<=0)})(t)||(i=atob(t),i=(new TextDecoder).decode(Uint8Array.from(i,(t=>t.charCodeAt(0)))))}catch(t){e.warn("Error decoding headline HTML:",t)}return i}(t.html,Rt(this,Tt,"f").logger),i=Rt(this,$t,"f").doc.createElement("div");i.classList.add("vturb-callaction-wrapper","callaction","callaction__html"),i.id=`vturb-callaction-${t.id}`,i.style.display="none",i.innerHTML=e,Rt(this,Ct,"f").appendChild(i)})),Nt(this,$t,t,"f"),Nt(this,Tt,e,"f"),Nt(this,Ct,Rt(this,wt,"m",It).call(this),"f"),Nt(this,xt,Rt(this,wt,"m",St).call(this),"f")}get style(){return Rt(this,xt,"f")}get container(){return Rt(this,Ct,"f")}renderInitialCallActions(t){Array.isArray(t)&&t&&(Rt(this,Tt,"f").logger.debug("Rendering call actions",{callActions:t,container:Rt(this,Ct,"f")}),Rt(this,Ct,"f").innerHTML="",Rt(this,xt,"f").innerHTML=yt.cssText+Et.cssText+At.cssText,t.forEach((t=>{try{"below_button"===t.type&&Rt(this,kt,"f").call(this,t),"custom_html"===t.type&&Rt(this,Lt,"f").call(this,t)}catch(e){Rt(this,Tt,"f").logger.error("Error rendering call action",{error:e,callAction:t})}})))}hideCurrentCallActionsAndShow(t,e){Array.isArray(t)&&Array.isArray(e)&&(e.includes("inner_button")||(Rt(this,Tt,"f").logger.debug("Toggling call actions",{callActions:t,types:e}),Rt(this,wt,"m",Mt).call(this),t.forEach((t=>Rt(this,wt,"m",Ot).call(this,t)))))}}$t=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,xt=new WeakMap,kt=new WeakMap,Lt=new WeakMap,wt=new WeakSet,It=function(){const t=`vturb-callaction-container-${Rt(this,$t,"f").id}`,e=Rt(this,$t,"f").doc.getElementById(t)||Rt(this,$t,"f").doc.createElement("div");return e.id=t,e.classList.add("callaction","callaction--outside"),Rt(this,$t,"f").insertAfter(e),e},St=function(){const t=`vturb-callaction-style-${Rt(this,$t,"f").id}`,e=Rt(this,$t,"f").doc.getElementById(t)||Rt(this,$t,"f").doc.createElement("style");return e.id=t,Rt(this,$t,"f").insertAfter(e),e},Mt=function(){try{Rt(this,Ct,"f").querySelectorAll(".vturb-callaction-wrapper").forEach((t=>{"style"in t&&(t.style.display="none")}))}catch(t){Rt(this,Tt,"f").logger.error("Error hiding all call actions",{error:t})}},Ot=function(t){try{const e=Rt(this,Ct,"f").querySelector(`#vturb-callaction-${t.id}`);e&&"style"in e&&(e.style.display="block")}catch(t){Rt(this,Tt,"f").logger.error("Error showing call action",{error:t})}};var Ut,Dt,zt,Ht,Vt,Bt,Wt,jt,Yt,Ft,Gt,Kt,qt,Xt,Jt,Zt,Qt,te,ee=function(t,e,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(t,i):a?a.value=i:e.set(t,i),i},ie=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class ne{constructor(i,a){Ut.add(this),this.alreadyPlayed=!1,this.currentTime=0,this.doc=document,this.inResume=!1,this.inSmartAutoPlay=!1,this.paused=!1,this.played=!1,this.urlParams=new URLSearchParams,this.volume=0,Dt.set(this,void 0),zt.set(this,void 0),Ht.set(this,void 0),Vt.set(this,new Map),Bt.set(this,[]),Wt.set(this,void 0),jt.set(this,void 0),this.onMessage=(i,a)=>{var r;switch(i){case"videoPause":this.paused=!0,this.played=!1,ie(this,Gt,"f").call(this,t.VIDEO_PAUSE,{});break;case"videoPlay":this.paused=!1,this.played=!0,this.alreadyPlayed=!0,ie(this,Gt,"f").call(this,t.VIDEO_PLAY,{});break;case"videoTimeUpdate":this.alreadyPlayed&&(this.currentTime=a.time,ie(this,Ut,"m",Ft).call(this),ie(this,Gt,"f").call(this,t.VIDEO_TIMEUPDATE,{time:this.currentTime}));break;case"volumeChange":this.volume=a.volume;break;case e.iframeOpenLink:ie(this,Ut,"m",Xt).call(this,a.url,a.target);break;case e.displayCallActions:ie(this,Wt,"f").renderInitialCallActions(a.call_actions);break;case e.callactionElementsChanged:ie(this,Wt,"f").hideCurrentCallActionsAndShow(a.call_actions,a.types),ie(this,Gt,"f").call(this,t.CALLACTION_ELEMENTS_CHANGED,{player:this});break;case e.displayHeadline:ie(this,Ut,"m",qt).call(this,a.headline,a.html,a.style);break;case e.enableConversionTraking:ie(this,Dt,"f").logger.debug("Enabling conversion tracking"),ie(this,zt,"f")||(ee(this,zt,new n(ie(this,Dt,"f").logger,this.urlUpdater.bind(this)),"f"),ie(this,Dt,"f").logger.debug("Enabled conversion tracking",ie(this,zt,"f")));break;case e.fullscreenEnter:ie(this,Ht,"f").classList.add("vturb-in-fullscreen"),ie(this,Gt,"f").call(this,t.FULLSCREEN_ENTER,{});break;case e.fullscreenExit:ie(this,Ht,"f").classList.remove("vturb-in-fullscreen"),ie(this,Gt,"f").call(this,t.FULLSCREEN_EXIT,{});break;case e.insertAfter:this.insertAfter(a.html);break;case e.insertBefore:ie(this,Ut,"m",Kt).call(this,a.html);break;case e.pitchTime:ie(this,Gt,"f").call(this,t.PITCH_TIME,{player:this});break;case e.reply:null===(r=ie(this,Vt,"f").get(a.reply))||void 0===r||r.call(this);break;case e.resume:this.inResume=a;break;case e.smartautoplayActive:ie(this,Gt,"f").call(this,t.SMARTAUTOPLAY_ACTIVE,{player:this});break;case e.smartautoplayInactive:ie(this,Gt,"f").call(this,t.SMARTAUTOPLAY_INACTIVE,{player:this});break;case e.smartautoplayVideoReady:ie(this,Gt,"f").call(this,t.SMARTAUTOPLAY_VIDEO_READY,{player:this});break;case e.smartplay:this.inSmartAutoPlay=a;break;case e.updateUrlParams:Object.entries(a.params).forEach((([t,e])=>{this.urlParams.set(t,e||"")})),ie(this,Dt,"f").logger.debug("Updated url params",a.params);break;case e.videoEnded:ie(this,Gt,"f").call(this,t.VIDEO_ENDED,{})}},Gt.set(this,((t,e)=>{ie(this,Ht,"f").dispatchEvent(new CustomEvent(t,{detail:e}))})),Jt.set(this,((t,e)=>{ie(this,Dt,"f").send(ie(this,Ht,"f"),t,e)})),this.id=i.id.replace("ifr_",""),ee(this,Ht,i,"f"),ie(this,Ht,"f").player=this,ee(this,Dt,a,"f"),ie(this,Dt,"f").logger.debug("Dispatching iframe connected event",this.id),document.dispatchEvent(new CustomEvent(t.IFRAME_CONNECTED,{detail:{id:this.id,player:this}})),ie(this,Ht,"f").dispatchEvent(new CustomEvent(t.IFRAME_CONNECTED,{detail:{id:this.id,player:this}})),ee(this,Wt,new Pt({iframe:this,controller:ie(this,Dt,"f")}),"f"),ee(this,jt,new URLSearchParams(this.doc.location.search),"f"),ie(this,jt,"f").delete("vl")}addEventListener(t,e,i){ie(this,Ht,"f").addEventListener(t,(t=>{t instanceof CustomEvent&&e(t)}),i)}displayHiddenElements(t,i,n={}){ie(this,Vt,"f").set(`displayHiddenElements-${t}`,(()=>{!function(t,e,i){e.forEach((e=>{t.querySelectorAll(e).forEach((t=>{t.style.display=null!=i?i:"block"}))}))}(this.doc,i,n.display),n.callback&&n.callback.call(this)})),ie(this,Jt,"f").call(this,e.displayHiddenElements,{options:{display:n.display,persist:n.persist},reply:`displayHiddenElements-${t}`,selectors:i,time:t})}fullscreen(t){ie(this,Jt,"f").call(this,e.fullscreen,{mode:t})}mute(){ie(this,Jt,"f").call(this,e.mute,{})}onTime(t,e){return function(t,e,i,n){return new(i||(i=Promise))((function(a,r){function o(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?a(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}l((n=n.apply(t,e||[])).next())}))}(this,arguments,void 0,(function*(t,e,i={}){var n;ie(this,Bt,"f").push({callback:e,once:null!==(n=i.once)&&void 0!==n&&n,time:t}),ie(this,Ut,"m",Ft).call(this)}))}pause(){ie(this,Jt,"f").call(this,e.videoPause,{})}play(){ie(this,Jt,"f").call(this,e.videoPlay,{})}seek(t){ie(this,Jt,"f").call(this,e.videoSeek,{time:t})}setVolume(t){ie(this,Jt,"f").call(this,e.volumeChange,{volume:t})}speed(t){ie(this,Jt,"f").call(this,e.videoSpeed,{speed:t})}unmute(){ie(this,Jt,"f").call(this,e.unmute,{})}urlUpdater(t,e){const i=new URL(t);return ie(this,Ut,"m",Yt).call(this,i,e),this.urlParams.forEach(((t,e)=>i.searchParams.set(e,t))),i.toString()}insertAfter(t){try{const e=ie(this,Ht,"f").parentElement;e?e.insertAdjacentHTML&&"string"==typeof t?e.insertAdjacentHTML("afterend",t):e.insertAdjacentElement&&t instanceof HTMLElement?e.insertAdjacentElement("afterend",t):ie(this,Dt,"f").logger.error("insertAdjacentHTML is not supported"):ie(this,Dt,"f").logger.error("Parent element not found")}catch(t){ie(this,Dt,"f").logger.error("Error inserting after",t)}}}Dt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,Vt=new WeakMap,Bt=new WeakMap,Wt=new WeakMap,jt=new WeakMap,Gt=new WeakMap,Jt=new WeakMap,Ut=new WeakSet,Yt=function(t,e){return e&&!r.some((t=>i(e,t)))||ie(this,jt,"f").forEach(((e,i)=>t.searchParams.set(i,e))),t},Ft=function(){ie(this,Bt,"f").forEach((t=>{this.currentTime>=t.time&&(t.callback.call(this),t.once&&ee(this,Bt,ie(this,Bt,"f").filter((e=>e!==t)),"f"))}))},Kt=function(t){try{const e=ie(this,Ht,"f").parentElement;e?e.insertAdjacentHTML&&"string"==typeof t?e.insertAdjacentHTML("beforebegin",t):e.insertAdjacentElement&&t instanceof HTMLElement?e.insertAdjacentElement("beforebegin",t):ie(this,Dt,"f").logger.error("insertAdjacentHTML is not supported"):ie(this,Dt,"f").logger.error("Parent element not found")}catch(t){ie(this,Dt,"f").logger.error("Error inserting before",t)}},qt=function(t,e,i){var n;ie(this,Dt,"f").logger.debug("Rendering headline",{headline:t,html:e,style:i});let a=this.doc.getElementById(`vturb-headline-${this.id}`);a||(a=this.doc.createElement("div"),a.id=`vturb-headline-${this.id}`,ie(this,Ut,"m",Kt).call(this,a),a.style.display="block",a.style.fontFamily="inherit",a.style.textAlign="left",a.style.width="100%",a.style.fontSize="18px",a.style.color="rgba(0, 0, 0, 1)",a.style.marginBottom="24px"),a&&(a.innerHTML=`
${e}
`);let r=this.doc.getElementById(`vturb-headline-style-${this.id}`);r||(r=this.doc.createElement("style"),r.id=`vturb-headline-style-${this.id}`,ie(this,Ut,"m",Kt).call(this,r)),r&&(r.innerHTML=i),"html"===t.type&&(null===(n=t.typography)||void 0===n?void 0:n.embedLink)&&((t,e,i)=>{if(t.getElementById(e))return;const n=t.createElement("link");n.id=e,n.setAttribute("href",i),n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),t.head.appendChild(n)})(this.doc,`vturb-headline-font-${t.typography.family.toLowerCase().replace(/\W+/g,"-")}`,t.typography.embedLink)},Xt=function(t,e){try{if(ie(this,Dt,"f").logger.debug("Opening link",{url:t,target:e}),!t)return;if(e&&"_blank"===e)return window.open(t,"_blank");this.doc.location.href=t}catch(t){ie(this,Dt,"f").logger.error("Error opening link",t)}},Zt=new WeakSet,Qt=function(){window.location.search.includes("vrb=1")&&(this.logger.debug("Adding remote debugger"),((t,e,i,n,a={})=>{if(t.getElementById(e))return;const r=t.createElement(n);r.id=e,"script"===n?r.src=i:r.href=i,Object.entries(a).forEach((([t,e])=>{r.setAttribute(t,e)})),t.head.appendChild(r)})(this.doc,"remote-debugger-script","https://remote-debugger.internal.vturb.com/target.js","script"))},te=function(){const t=this.doc.createElement("style");t.id="vturb-fullscreen-style-tag",t.type="text/css",t.innerHTML="\n iframe.vturb-in-fullscreen {\n object-fit: contain !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 9999999 !important; // Ensures player stays above other elements when in fullscreen mode\n overflow: hidden !important;\n }\n ",this.doc.head.appendChild(t)},window.vturbSdk=new class{constructor(t){Zt.add(this),this.doc=document,this.connectedIframes=new Map,this.pendingMessages=new Map,this.settings={delay:{initial:2,max:2e4}},this.logger=new h("IframeSdkHost"),this.settings=null!=t?t:this.settings,this.connect(),this.observeIframes(),ie(this,Zt,"m",Qt).call(this),ie(this,Zt,"m",te).call(this)}get(t){return this.connectedIframes.get(t)}send(t,e,i){var n;null===(n=t.contentWindow)||void 0===n||n.postMessage({mime:a,payload:i,type:e},"*")}connect(){this.logger.debug("Connecting to iframe"),window.addEventListener("message",(({data:t})=>{t.mime===a&&(t.type===e.connect?this.onConnect(t):this.onReceiveMessage(t))}))}observeIframes(){this.logger.debug("Observing iframes");let{initial:t}=this.settings.delay;const e=this.settings.delay.max,i=()=>{document.querySelectorAll("iframe[id^='ifr_']").forEach((t=>{const e=t.id.replace("ifr_","");this.connectedIframes.has(e)||this.send(t,"connect",{})})),te&&(t=e),setTimeout(i,t)};i()}onConnect(t){var e,i,n,a;const{iframe:r,wrapper:o,aspectWrapper:s}=this.getIframeElements(t.id);if(r&&!this.connectedIframes.has(t.id)){o&&(null===(e=t.payload)||void 0===e?void 0:e.isVideoVertical)&&(o.style.maxWidth=m(),window.addEventListener("resize",(()=>{o.style.maxWidth=m()}))),s&&(null===(i=t.payload)||void 0===i?void 0:i.aspect)&&(s.style.paddingTop=`${null===(n=t.payload)||void 0===n?void 0:n.aspect}%`);const l=new ne(r,this);this.connectedIframes.set(t.id,l),this.pendingMessages.has(t.id)&&(null===(a=this.pendingMessages.get(t.id))||void 0===a||a.forEach((t=>{l.onMessage(t.type,t.payload)})),this.pendingMessages.delete(t.id))}}getIframeElements(t){const e=document.getElementById(`ifr_${t}_wrapper`)||document.querySelector(`div[data-alternative-id="${t}"]`),i=null==e?void 0:e.querySelector('div[id$="_aspect"]'),n=null==e?void 0:e.querySelector("iframe");return{wrapper:e,aspectWrapper:i,iframe:n}}onReceiveMessage(t){var e;if(this.connectedIframes.has(t.id)){const e=this.connectedIframes.get(t.id);e&&e.onMessage(t.type,t.payload)}else this.logger.info("Iframe not found",t.id),this.pendingMessages.has(t.id)?null===(e=this.pendingMessages.get(t.id))||void 0===e||e.push(t):this.pendingMessages.set(t.id,[t])}}})(); //# sourceMappingURL=sdk.js.map